<template>
  <div>
    采购管理
    <div id="main" style="width: 500px; height: 400px;"></div>
  </div>
</template>

<script>
import echarts,{init} from '../plugins/index'  

export default {
  data() {
    return {}
  },
  methods: {
    handleecharts() {
      let mychart = init(document.getElementById('main'))
      mychart.setOption({
        title: {
          text: 'ECharts 入门示例ws'
        },
        tooltip: {},
        xAxis: {
          type: 'category', // 指定类型为category
          data: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子']
        },
        yAxis: {
          type: 'value' // 指定类型为value
        },
        series: [
          {
            name: '销量',
            type: 'bar',
            data: [5, 20, 36, 10, 10, 20]
          }
        ]
      })
    }
  },
  mounted() {
    this.handleecharts()
  }
}
</script>

<style>
#main {
  width: 500px;
  height: 400px;
}
</style>